function [k,F] = buildspecfil2(ts,D,M,eps)
% buildspecfil2(ts,D,M,eps)
% 
% 	Parameters:
% 		ts: 	time series
% 		D:	inital displacement
% 		M:	kernel size
% 		eps:	amount to perturb D by at each time step in order to make displacement a function 
% 			of time.
% 		
% 
% 	Outputs:
% 		k	the kernel
% 		F	the desired filter
% 
% 	Purpose of this code:
% 	This code is designed to build a specific filter with two terms of the Taylore Expansion
% 	that can be used for interpolation and to return it.  (NOTE:  It is unlikely that is code is 
% 	properly coded at this time.)
N = M;
mesh = 1:N;
for j = 1:N
        asmesh(j) = mesh(j) - (D + (j-1).*eps);
        %asmesh(j) = mesh(j) - (D + eps);
end
%delta(1) = 0;
%for j = 2:N
%    delta(j) = asmesh(j) - asmesh(j-1);
%end

w = getWindow('blackman3',M,D);

Dadj = D - (M-1)/2; % adjust delay for kernel length

Dint = round(Dadj); % integer portion of delay
%Dint = floor(Dadj); % integer portion of delay


k = (-(M-1)/2):1:((M-1)/2); % kernel index
s = (Dadj-Dint)-k; % filter argument
F1 = (sinc(s)).*w;
F2 = (sincdir(s)).*w;

F = F1 + eps.*F2;
end